package com.treasure.mall.zbq.common.exception;

import com.treasure.mall.zbq.common.base.ApiResult;
import lombok.Getter;

/**
 * @author allan
 * @date 2018-09-14
 */
@Getter
public class ApiException extends RuntimeException {
    private ApiResult apiResult;

    public ApiException(ApiResult apiResult) {
        super(apiResult.getResultMsg());
        this.apiResult = apiResult;
    }

    public ApiException(String msg) {
        super(msg);
        this.apiResult = ApiResult.error(msg);
    }
}
